{% extends "park/base.html" %}

{% block css %}
{% endblock %}

{% block content %}
<script type="text/javascript">
var primary_menu = "menu_4";
var sub_menu = "menu_4_2";
</script>

    <div class="col-md-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <div class="panel-title"><h3>园区企业列表</h3></div>
                <div class="panel-options">
                	<form role="form" action="" method="get" enctype="" class="form-horizontal pull-left">
                         <div class="form-group">
                             <label class="control-label">名称：</label>
                             <div>
                                <input name="name" type="text"  />
                             </div>
                         </div>
                         <div class="form-group filter-btn">
                            <input type="submit" class="btn btn-success" value="筛选">
                         </div>
                     </form>
                    <!-- <a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a> -->
                 </div>
            </div>
            <div class="panel-body with-table">
                <table class="table table-bordered table-responsive">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>企业名称</th>
                        <th>登陆用户名</th>
                        <th>登陆密码</th>
                        <th>是否禁用</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for company in contacts %}
                        <tr>
                            <td>{{ company.id }}</td>
                            <td>{{ company.name }}</td>
                            <td>{{ company.user.username }}</td>
                            <td>{{ company.user.password }}</td>
                            <td>{% if company.disable == '0' %}
                                    否
                                {% else %}
                                    是
                                {% endif %}

                            </td>
                            <td>
                                <a href="/park/chemicalsList/{{ company.id }}" class="btn btn-success">查看其它特征化学污染物信息</a>
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-xs-6 col-left">
                        <div class="dataTables_info" id="table-3_info"></div>
                    </div>
                    <div class="col-xs-6 col-right">
                            <ul class="pagination pagination-sm" >
                                {% if contacts.has_previous %}
                                    <li><a href="?page={{ contacts.previous_page_number }}">上一页</a></li>
                                {% else %}
                                    <li class="disabled"> <span>上一页</span></li>
                                {% endif %}
                                {% for p in paginator.page_range %}
                                    {% ifequal p contacts.number %}
                                        <li class="active"> <span class="p">{{p}}</span></li>
                                    {% else%}
                                        <li> <a href="?page={{ p }}">{{p}}</a></li>
                                    {% endifequal %}
                                {% endfor %}
                                {% if contacts.has_next %}
                                    <li class="next">  <a href="?page={{ contacts.next_page_number }}">下一页</a></li>
                                {% else %}
                                    <li class="disabled"><span>下一页</span></li>
                                {% endif %}
                            </ul>
                        </div>
                    </div>
                </div>

            </div>

        </div>
  


{% endblock %}

{% block js %}

<script src="/static/js/date-choose.js"></script>
<script language="javascript">

    function getNextElement (field) {
        var form = field.form;
        for (var e = 0; e < form.elements.length; e++)
            if (field == form.elements[e])
                break;

        return form.elements[++e % form.elements.length];
    }
    function tabOnEnter (field, evt) {
        var keyCode = document.layers ? evt.which : document.all ?
                evt.keyCode : evt.keyCode;
        if (field.value.length == 1){
            getNextElement(field).focus();
            return false;
        }
    }
</script>
{% endblock %}